<article class="auth">
  <h1 class="auth-header">Sign In</h1>

  <%= if @person do %>
    <div class="form_submit_response form_submit_response--success"><p>Check your email! We sent you a single-use sign in link. It will expire in <%= PublicHelpers.auth_link_expires_in(@person) %>.</p></div>
    <%= if Mix.env == :dev do %>
      <p>Psst! Since you're hacking we'll just skip the email process. <%= link "click here", to: auth_path(@conn, @person) %> instead!</p>
    <% end %>
  <% else %>
    <p class="auth-links">via <a href="/auth/github" title="Sign in via GitHub">GitHub</a></p>
    <%= form_for @conn, Routes.sign_in_path(@conn, :new), [as: :auth, class: "form form--full_width"], fn f -> %>
      <div class="form-element_wrap">
        <div class="form-element">
          <label>via Email Address</label>
          <%= email_input(f, :email, placeholder: "grace@hopper.com", autocapitalize: "none", autofocus: true, required: true) %>
        </div>
      </div>
      <div class="form-submit">
        <div class="form-submit-note">
          <div>Need an account? <em><%= link "Sign up", to: Routes.person_path(@conn, :join), title: "" %></em></div>
        </div>
        <input type="submit" value="Enter">
      </div>
    <% end %>
  <% end %>
</article>
